// import {
//   getList
// } from '@/api/table.js'

import { findByIdInvoiceInfo } from '@/api/invoice'

export default {
  data() {
    return {
      detailInfo: {
        invoiceType: ''
      }

    }
  },
  created() {
    const id = this.$route.query.id
    this.getDatas(id)
  },
  watch: {
    $route: { // 监听路由
      handler: function(route) {

      },
      immediate: true
    }
  },
  methods: {
    getDatas(id) {
      const param = {
        id: id
      }
      findByIdInvoiceInfo(param).then(response => {
        if (response.code === 200 || response.code === 20000) {
          this.detailInfo = response.result[0]
        } else {
          this.$message({
            type: 'info',
            message: '查询失败'
          })
        }
      })
    }
  }
}
